/**
 * 
 */
package com.wolfware.athsweb.persistancy;

import java.util.List;

/**
 * @author cstrzadala
 *
 */
public interface GenericDAO<ID extends Number, E> {

    /**
     * Create method.
     * Save the a generic entity to database
     * 
     * @param entity : Generic Param
     */
    void create(final E entity);

    /**
     * Read.
     * 
     * @param id param
     * @return val
     */
    E read(final ID id);

    /**
     * Update.
     * 
     * @param entity param
     */
    void update(final E entity);

    /**
     * Delete.
     * 
     * @param entity
     *            param
     */
    void delete(final E entity);

    /**
     * @return List - A list of objects
     */
    List<E> findAll();

    /**
     * Find by example.
     * 
     * @param example param
     * @return list
     */
    List<E> findByExample(final E example);
}